// const { override, addDecoratorsLegacy } = require("customize-cra")

// module.exports = override(
//   addDecoratorsLegacy()
// )
const path = require('path')
const { override, addDecoratorsLegacy } = require('customize-cra')
function resolve(dir) {
  return path.join(__dirname, dir)
} 
const customize = () => (config, env) => {
  config = injectBabelPlugin(["@babel/plugin-proposal-decorators", { legacy: true }], config);
  config.resolve.alias['@'] = resolve('src')
  if (env === 'production') {
    config.externals = { 'react': 'React', 'react-dom': 'ReactDOM' }
  }
  return config
}
module.exports = override(addDecoratorsLegacy(), customize())